<template>
	<view>
		<!-- 余额显示 -->
		<view class="yue_show_box">
			
			<view class="box">
				<view class="show_box">
					<view class="top">
						<view class="tit">
							<text>总资产（元）</text>
							<!-- <image src="../../../static/eyes.png" mode=""></image> -->
						</view>
						<text class="money">￥{{yue_info.balance}}</text>
					</view>
					<view class="top_img">
						<image src="../../../static/yue_bg.png" mode=""></image>
					</view>
				</view>
				
				<view class="bottom">
					<!-- <view class="tit_box">
						<text class="text">充值金额</text>
						<text class="num">{{yue_info.topup}}</text>
					</view> -->
					
					<view class="tit_box">
						<text class="text">提现金额</text>
						<text class="num">{{yue_info.withdraw}}</text>
					</view>
					
					<view class="tit_box">
						<text class="text">转赠金额</text>
						<text class="num">{{yue_info.gsts}}</text>
					</view>
					
					<view class="tit_box">
						<text class="text">分红金额</text>
						<text class="num">{{yue_info.dividend}}</text>
					</view>
				</view>
			</view>
			
		</view>
		
		<!-- 充值记录 -->
<!-- 		<view style="height: 10rpx;background-color: #f5f5f5;"></view> -->
		<view class="recharge_record">
			
			<view class="tit_box">
				余额记录
			</view>
			
			<view class="record" v-for="(item,index) in yue_details" :key="index" v-if="yue_details.length > 0">
				<view class="tit">
					<text>{{item.type.type_name}}</text>
					<text class="num" v-if="item.type.type_value == 1" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 2" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 3" style="color: cadetblue;">-{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 4" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 5" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 6" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 7" style="color: cadetblue;">-{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 8" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 9" style="color: crimson;">+{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 10" style="color: cadetblue;">-{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 11" style="color: cadetblue;">-{{item.value}}</text>
					<text class="num" v-if="item.type.type_value == 12" style="color: crimson;">+{{item.value}}</text>
				</view>
				<view class="bot">
					<text>{{item.addtime}}</text>
					<text class="num">¥{{item.money}}</text>
				</view>
			</view>
			<view class="no_box" v-if="yue_details.length == 0">
				<image src="https://wanchuyun-img.oss-cn-beijing.aliyuncs.com/guomai/4062acbda4e6e8e31fc48cc5eebe90f1f2230fef.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				yue_details: '',
				yue_info: ''
			};
		},
		onLoad() {
			this.getYuedetail()
		},
		methods:{
			// 余额明细
			getYuedetail(){
				let that = this;
				app.globalRequest({
					api: app.getApi().user.yueDetail,
				}).then(res => {
					if (res.code == 1) {
						that.yue_details = res.data.recordList
						that.yue_info = res.data
					}
				}).catch(err => {
				
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #FBFBFB;

	}
	.recharge_record{
		width: 93%;
		// background-color: #fff;
		padding: 0rpx 24rpx 24rpx;
		box-sizing: border-box;
		background-color: #fff;
		margin: 24rpx auto 0;
		border-radius: 16rpx;
		.tit_box{
			padding: 40rpx 0 ;
			box-sizing: border-box;
			color: #333333;
			font-weight: bold;
			font-size: 29rpx;
			
		}
		
		.record{
			display: flex;
			flex-direction: column;
			border-top: 2rpx solid #EEEEEE;
			padding: 20rpx 0 ;
			box-sizing: border-box;
			.tit{
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 20rpx;
				text{
					font-weight: bold;
					font-size: 28rpx;
					color: #111111;
				}
				.num{
					color: #EC1818;
				}
			}
			.bot{
				display: flex;
				align-items: center;
				justify-content: space-between;
				text{
					font-size: 28rpx;
					color: #999999;
				}
			}
		}
	}
	
	.no_box{
		width: 520rpx;
		height: 360rpx;
		margin: 200rpx auto;
		image{
			width: 100%;
			height: 100%;
		}
	}
	
	.yue_show_box{
		width: 100%;
		padding: 24rpx;
		box-sizing: border-box;
		background-color: #fff;
		.box{
			width: 100%;
			background: url('https://wanchuyun-img.oss-cn-beijing.aliyuncs.com/guomai/5cad88852f93ee334083642df4e1142a91e5136b.png');
			background-position: center;
			background-size: 100%;
			height: 352rpx;
			padding: 30rpx 24rpx;
			box-sizing: border-box;
			.show_box{
				display: flex;
				justify-content: space-between;
				.top{
					display: flex;
					flex-direction: column;
					.tit{
						display: flex;
						align-items: center;
						text{
							color: #fff;
							font-size: 25rpx;
						}
						image{
							width: 36rpx;
							height: 23rpx;
							margin-left: 15rpx;
						}
					}
					.money{
						font-weight: bold;
						font-size: 57rpx;
						color: #fff;
						margin-top: 10rpx;
					}
				}
				.top_img{
					width: 168rpx;
					height: 178rpx;
					margin-top: -20rpx;
					image{
						width: 100%;
						height: 100%;
					}
				}
			}
			
			.bottom{
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 50rpx;
				
				.tit_box{
					display: flex;
					flex-direction: column;
					align-items: center;
					.text{
						color: #FFDCC9;
						font-size: 29rpx;
					}
					.num{
						font-weight: bold;
						font-size: 29rpx;
						color: #FFDCC9;
						margin-top: 15rpx;
					}
				}
			}
		}
	}
</style>
